<%--
  Created by IntelliJ IDEA.
  User: xiaoding
  Date: 2021/1/8
  Time: 8:43
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>头部</title>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/bootstrap-3.3.7-dist/css/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/bootstrap-3.3.7-dist/css/Style.css">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/bootstrap-3.3.7-dist/css/head.css">
    <script src="${pageContext.request.contextPath}/bootstrap-3.3.7-dist/js/JQuery.js" type="text/javascript" charset="utf-8"></script>
    <script src="${pageContext.request.contextPath}/bootstrap-3.3.7-dist/js/bootstrap.js" type="text/javascript" charset="utf-8"></script>
    <script src="${pageContext.request.contextPath}/bootstrap-3.3.7-dist/js/head.js" type="text/javascript" charset="utf-8"></script>
    <script>
        $(function () {
            //退出登录
            $("#exit").click(function () {
                window.location.href = "LoginServlet?flag=exit";
            });
        })
    </script>
</head>
<body>
    <div class="container-fluid head">
        <img src="${pageContext.request.contextPath}/images/Logo.jpg">
        <img class="book" src="${pageContext.request.contextPath}/images/userName.png">
        <div class="userName">
           <span>
               ${sessionScope.user.uName}
           </span>
        </div>
        <div class="nav-top">
            <a href="BookServlet?flag=select">图书查询</a>
            <a href="HistoryServlet?flag=selectBorrow">图书借阅</a>
            <a href="HistoryServlet?flag=selectReturn" class="a2">图书归还</a>
            <a href="#" class="geRen">
                <span>个人中心</span>
                <ul class="xinXi">
                    <li id="geRenXinxi">个人信息</li>
                    <li id="updatePws">修改密码</li>
                    <li id="exit">退出账号</li>
                </ul>
            </a>
        </div>
    </div>

    <%-- 信息窗口 开始 --%>
    <form action="UserServlet?flag=update" class="popupWin" method="post" id="popupWin">
        <h3>个人信息</h3>
        <div class="popupWinInput">
            <input type="hidden" value="${sessionScope.user.uId}" name="uId" id="uId">
            <input type="hidden" value="${sessionScope.user.pws}" name="pws" id="pws">
            <p>
                <span>账号：</span>
                <input type="text" value="${sessionScope.user.account}" name="account" id="account">
            </p>
            <p>
                <span>姓名：</span>
                <input type="text" value="${sessionScope.user.uName}" name="uName" id="uName">
            </p>
            <p>
                <span>邮箱：</span>
                <input type="email" value="${sessionScope.user.email}" name="email" id="email">
            </p>
            <p>
                <span>借阅天数：</span>
                <input type="text" value="${sessionScope.user.count}" name="count" id="count">
            </p>
            <p>
                <span>年龄：</span>
                <input type="text" value="${sessionScope.user.age}" name="age" id="age">
            </p>
            <p>
                <span>性别：</span>
                <%--  if-else判断  --%>
                <c:choose>
                    <c:when test="${sessionScope.user.sex eq '男'}">    <!--如果 -->
                        <input type="radio" class="sex" name="sex" value="男" checked id="sex">男
                        <input type="radio" class="sex" name="sex" value="女" id="sex1">女
                    </c:when>

                    <c:otherwise>  <!--否则 -->
                        <input type="radio" class="sex" name="sex" value="男" id="sex">男
                        <input type="radio" class="sex" name="sex" value="女" checked id="sex1">女
                    </c:otherwise>
                </c:choose>
            </p>
        </div>
        <hr>
        <div class="popupWinButton">
            <input type="submit"  value="修改">
            <input type="button" id="queDing" value="确定">
        </div>
    </form>
    <%-- 信息窗口 结束 --%>

    <%-- 修改密码窗口 开始 --%>
    <form action="UserServlet?flag=updatePws" class="popupWin" method="post" id="popupWin2">
        <h3>个人信息</h3>
        <div class="popupWinInput">
            <input type="hidden" value="${sessionScope.user.uId}" name="uId" id="uId2">
            <p>
                <span>原密码：</span>
                <input type="password" placeholder="请输入旧密码" name="oldPws" id="oldPws">
            </p>
            <p>
                <span>新密码：</span>
                <input type="password" placeholder="请输入新密码" name="newPws" id="newPws">
            </p>
            <hr>
            <div class="popupWinButton">
                <input type="submit"  value="修改">
                <input type="button" id="queDing2" value="确定">
            </div>
        </div>
    </form>
    <%-- 修改密码窗口 结束 --%>
</body>
</html>
